Skip to content

replace ls and rm with find#84

Open
pdimens wants to merge 2 commits intojpuritz:masterfrom
pdimens:master
Open

replace ls and rm with find#84
pdimens wants to merge 2 commits intojpuritz:masterfrom
pdimens:master

Conversation

@pdimens
Copy link
Copy Markdown
Contributor

@pdimens pdimens commented Oct 20, 2022

This PR attempts to fix the issues described in #83 by leveraging find.

  • In cases where ls is used to search for wildcard-ed files, find is restricted to -maxdepth 1 (current folder, no recursion), -type f (must be a file, not directory), and has the extra -printf directive to output only the filename without the path.
  • In cases where rm was used on wildcarded files (e.g. mapped.*.bed), find was used with the same restrictions, except -printf was replaced with -delete, which will unsurprisingly delete whatever files find identifies meeting the criteria.

Note
I have not tested this yet (I don't have data to test it on atm)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant